﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ECommerce.DAO.Controles
{
    public static class WebControl
    {
        public static ECommerce.Model.Controles.WebControl GetWebControlById(int Id)
        {
            ECommerce.Model.Controles.WebControl result = ECommerce.DAO.Cache.Controles.WebControl.GetWebControlById(Id);
            if (result != null)
                return result;
            else
            {
                result = ECommerce.DAO.SQL.Controles.WebControl.GetWebControlById(Id);
                ECommerce.DAO.Cache.Controles.WebControl.SetWebControl(result);
            }
            return result;
        }
        public static ECommerce.Model.Controles.WebControl[] GetWebControlsDelSistema()
        {
            ECommerce.Model.Controles.WebControl[] result = ECommerce.DAO.Cache.Controles.WebControl.GetWebControlsDelSistema();
            if (result != null)
                return result;
            else
            {
                result = ECommerce.DAO.SQL.Controles.WebControl.GetWebControlsDelSistema();
                ECommerce.DAO.Cache.Controles.WebControl.SetWebControlsDelSistema(result);
                return result;
            }
        }
        public static ECommerce.Model.Controles.WebControl[] GetWebControlsByWebControlId(int IdWebControl)
        {
            ECommerce.Model.Controles.WebControl[] result = ECommerce.DAO.Cache.Controles.WebControl.GetWebControlsByWebControlId(IdWebControl);
            if (result != null)
                return result;
            else
            {
                result = ECommerce.DAO.SQL.Controles.WebControl.GetWebControlsByWebControlId(IdWebControl);
                ECommerce.DAO.Cache.Controles.WebControl.SetWebControlsByWebControl(result, IdWebControl);
                return result;
            }
        }

    }
}
